<template>
  <div class="content">
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{path:'/'}">首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{path:'/policylaw/list'}">政策法规列表页</el-breadcrumb-item>
      <el-breadcrumb-item >政策法规详情页</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="main">
      <h1 class="title">{{ title }}</h1>
      <div class="publish">
        <span style="color: #333;font-size: 14px;">发布企业：</span>
        <span style="color: #666;font-size: 14px;margin-right: 15px;">{{ publisher }}</span>
        <span style="color: #333;font-size: 14px;">发布时间：</span>
        <span style="color: #666;font-size: 14px;">{{ publishDataTime }}</span>
      </div>
      <div class="bidContent" ref="bidContent" style="text-align: left;"></div>
      <div class="downFile">
        <ul>
          <template v-for="item in fileList">
            <li @click="downFile(item.fileName)">
              <span>附件：</span>
              <span>{{ item.fileName }}</span>
            </li>
          </template>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import {getPolicylaw} from '@/api/bid/policylaw'
import {download} from '@/utils/neu'

export default {
  name: "detail",
  methods: {
    downFile(fileName){
      download(fileName)
    }
  },
  data() {
    return {
      id:null,
      title:'',
      publisher:'',
      publishDataTime:'',
      content:'',
      fileList:[]
    }
  },
  async created() {
    this.id=this.$route.query.id
  },
  mounted() {
    getPolicylaw(this.id).then(res=>{
      console.log(res);
      this.title = res.data.title
      this.publisher = res.data.publisher
      this.publishDataTime = this.parseTime(res.data.publishDatetime,'{y}年{m}月{d}日')
      this.bidContent = res.data.content
      this.$refs.bidContent.innerHTML = this.bidContent
      this.fileList = res.data.filesList
    })
  },

}
</script>

<style lang="scss" scoped>
.content{
  width: 90%;
  .main{
    margin: 30px;

    .downFile{
      li{
        list-style: none;
        display: flex;
        justify-content: left;
        font-size: 14px;
        color: gray;
        
      }
      :hover{
        color: #1dd0b7;
      }
    }
  }
}
</style>
